convert dto to dictionary c#

106

convert dto to dictionary c# -

 someObject.GetType()
     .GetProperties(BindingFlags.Instance | BindingFlags.Public)
          .ToDictionary(prop => prop.Name, prop => prop.GetValue(someObject, null))

Comments

Submit
0 Comments